|
1
|
|
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[17],{ |
|
2
|
|
|
|
|
3
|
|
|
/***/ 1007: |
|
4
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
5
|
|
|
|
|
6
|
|
|
"use strict"; |
|
7
|
|
|
__webpack_require__.r(__webpack_exports__); |
|
8
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); |
|
9
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
|
10
|
|
|
/* harmony import */ var react_resize_detector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1004); |
|
11
|
|
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(964); |
|
12
|
|
|
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_2__); |
|
13
|
|
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } |
|
|
|
|
|
|
14
|
|
|
|
|
15
|
|
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } |
|
16
|
|
|
|
|
17
|
|
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } |
|
18
|
|
|
|
|
19
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|
20
|
|
|
|
|
21
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
|
|
|
|
|
|
22
|
|
|
|
|
23
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } |
|
|
|
|
|
|
24
|
|
|
|
|
25
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } |
|
26
|
|
|
|
|
27
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } |
|
28
|
|
|
|
|
29
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
|
|
|
|
|
|
30
|
|
|
|
|
31
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } |
|
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } |
|
34
|
|
|
|
|
35
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
|
36
|
|
|
|
|
37
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
var DicomMicroscopyViewport = |
|
42
|
|
|
/*#__PURE__*/ |
|
43
|
|
|
function (_Component) { |
|
44
|
|
|
_inherits(DicomMicroscopyViewport, _Component); |
|
45
|
|
|
|
|
46
|
|
|
function DicomMicroscopyViewport(props) { |
|
47
|
|
|
var _this; |
|
48
|
|
|
|
|
49
|
|
|
_classCallCheck(this, DicomMicroscopyViewport); |
|
50
|
|
|
|
|
51
|
|
|
_this = _possibleConstructorReturn(this, _getPrototypeOf(DicomMicroscopyViewport).call(this, props)); |
|
52
|
|
|
|
|
53
|
|
|
_defineProperty(_assertThisInitialized(_this), "state", { |
|
54
|
|
|
error: null |
|
55
|
|
|
}); |
|
56
|
|
|
|
|
57
|
|
|
_defineProperty(_assertThisInitialized(_this), "viewer", null); |
|
58
|
|
|
|
|
59
|
|
|
_defineProperty(_assertThisInitialized(_this), "onWindowResize", function () { |
|
60
|
|
|
_this.debouncedResize(); |
|
61
|
|
|
}); |
|
62
|
|
|
|
|
63
|
|
|
_this.container = react__WEBPACK_IMPORTED_MODULE_0___default.a.createRef(); |
|
64
|
|
|
_this.debouncedResize = lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default()(function () { |
|
65
|
|
|
if (_this.viewer) _this.viewer.resize(); |
|
|
|
|
|
|
66
|
|
|
}, 100); |
|
67
|
|
|
return _this; |
|
68
|
|
|
} // install the microscopy renderer into the web page. |
|
69
|
|
|
// you should only do this once. |
|
70
|
|
|
|
|
71
|
|
|
|
|
72
|
|
|
_createClass(DicomMicroscopyViewport, [{ |
|
73
|
|
|
key: "installOpenLayersRenderer", |
|
74
|
|
|
value: function installOpenLayersRenderer(container, displaySet) { |
|
75
|
|
|
var _this2 = this; |
|
76
|
|
|
|
|
77
|
|
|
var dicomWebClient = displaySet.dicomWebClient; |
|
78
|
|
|
var searchInstanceOptions = { |
|
79
|
|
|
studyInstanceUID: displaySet.StudyInstanceUID, |
|
80
|
|
|
seriesInstanceUID: displaySet.SeriesInstanceUID |
|
81
|
|
|
}; |
|
82
|
|
|
dicomWebClient.searchForInstances(searchInstanceOptions).then(function (instances) { |
|
83
|
|
|
var promises = []; |
|
84
|
|
|
|
|
85
|
|
|
for (var i = 0; i < instances.length; i++) { |
|
86
|
|
|
var sopInstanceUID = instances[i]['00080018']['Value'][0]; |
|
87
|
|
|
var retrieveInstanceOptions = { |
|
88
|
|
|
studyInstanceUID: displaySet.StudyInstanceUID, |
|
89
|
|
|
seriesInstanceUID: displaySet.SeriesInstanceUID, |
|
90
|
|
|
sopInstanceUID: sopInstanceUID |
|
91
|
|
|
}; |
|
92
|
|
|
var promise = dicomWebClient.retrieveInstanceMetadata(retrieveInstanceOptions).then(function (metadata) { |
|
93
|
|
|
var ImageType = metadata[0]['00080008']['Value']; |
|
94
|
|
|
|
|
95
|
|
|
if (ImageType[2] === 'VOLUME') { |
|
|
|
|
|
|
96
|
|
|
return metadata[0]; |
|
97
|
|
|
} |
|
98
|
|
|
}); |
|
99
|
|
|
promises.push(promise); |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
return Promise.all(promises); |
|
103
|
|
|
}).then( |
|
104
|
|
|
/*#__PURE__*/ |
|
105
|
|
|
function () { |
|
106
|
|
|
var _ref = _asyncToGenerator( |
|
107
|
|
|
/*#__PURE__*/ |
|
108
|
|
|
regeneratorRuntime.mark(function _callee(metadata) { |
|
|
|
|
|
|
109
|
|
|
var _ref2, api, microscopyViewer; |
|
110
|
|
|
|
|
111
|
|
|
return regeneratorRuntime.wrap(function _callee$(_context) { |
|
|
|
|
|
|
112
|
|
|
while (1) { |
|
113
|
|
|
switch (_context.prev = _context.next) { |
|
114
|
|
|
case 0: |
|
115
|
|
|
metadata = metadata.filter(function (m) { |
|
116
|
|
|
return m; |
|
117
|
|
|
}); |
|
118
|
|
|
_context.next = 3; |
|
119
|
|
|
return __webpack_require__.e(/* import() | dicom-microscopy-viewer */ 10).then(__webpack_require__.t.bind(null, 1003, 7)); |
|
120
|
|
|
|
|
121
|
|
|
case 3: |
|
122
|
|
|
_ref2 = _context.sent; |
|
123
|
|
|
api = _ref2.api; |
|
|
|
|
|
|
124
|
|
|
microscopyViewer = api.VLWholeSlideMicroscopyImageViewer; |
|
|
|
|
|
|
125
|
|
|
_this2.viewer = new microscopyViewer({ |
|
|
|
|
|
|
126
|
|
|
client: dicomWebClient, |
|
127
|
|
|
metadata: metadata, |
|
128
|
|
|
retrieveRendered: false |
|
129
|
|
|
}); |
|
130
|
|
|
|
|
131
|
|
|
_this2.viewer.render({ |
|
132
|
|
|
container: container |
|
133
|
|
|
}); |
|
134
|
|
|
|
|
135
|
|
|
case 8: |
|
136
|
|
|
case "end": |
|
137
|
|
|
return _context.stop(); |
|
138
|
|
|
} |
|
139
|
|
|
} |
|
|
|
|
|
|
140
|
|
|
}, _callee); |
|
141
|
|
|
})); |
|
142
|
|
|
|
|
143
|
|
|
return function (_x) { |
|
|
|
|
|
|
144
|
|
|
return _ref.apply(this, arguments); |
|
145
|
|
|
}; |
|
146
|
|
|
}()); |
|
147
|
|
|
} |
|
148
|
|
|
}, { |
|
149
|
|
|
key: "componentDidMount", |
|
150
|
|
|
value: function componentDidMount() { |
|
151
|
|
|
var displaySet = this.props.viewportData.displaySet; |
|
152
|
|
|
this.installOpenLayersRenderer(this.container.current, displaySet); |
|
153
|
|
|
} |
|
154
|
|
|
}, { |
|
155
|
|
|
key: "render", |
|
156
|
|
|
value: function render() { |
|
157
|
|
|
var style = { |
|
158
|
|
|
width: '100%', |
|
159
|
|
|
height: '100%' |
|
160
|
|
|
}; |
|
161
|
|
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { |
|
162
|
|
|
className: 'DicomMicroscopyViewer', |
|
163
|
|
|
style: style |
|
164
|
|
|
}, react_resize_detector__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"] && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_resize_detector__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], { |
|
165
|
|
|
handleWidth: true, |
|
166
|
|
|
handleHeight: true, |
|
167
|
|
|
onResize: this.onWindowResize |
|
168
|
|
|
}), this.state.error ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h2", null, JSON.stringify(this.state.error)) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { |
|
169
|
|
|
style: style, |
|
170
|
|
|
ref: this.container |
|
171
|
|
|
})); |
|
172
|
|
|
} |
|
173
|
|
|
}]); |
|
174
|
|
|
|
|
175
|
|
|
return DicomMicroscopyViewport; |
|
176
|
|
|
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); |
|
177
|
|
|
|
|
178
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (DicomMicroscopyViewport); |
|
179
|
|
|
|
|
180
|
|
|
/***/ }) |
|
181
|
|
|
|
|
182
|
|
|
}]); |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.